package com.hx.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hx.pojo.CosRepository;
import com.hx.pojo.CosmeticInfo;

@Component
public class CosService {
	@Autowired
	private CosRepository cr;
	
	public void save(CosmeticInfo cos){
		cr.save(cos);
	}
	
	public List<CosmeticInfo> findAll(){
		return (List<CosmeticInfo>) cr.findAll();
	}
	
	public CosmeticInfo findByCosmeticId(Integer id){
		return cr.findOne(id);
	}
}
